build:
	go build main.go

V:=$(shell cat plugin.go | grep -o -E 'Ver = "[0-9]+\.[0-9]+\.[0-9]+' | sed 's/Ver = "//g')
plugin:
	go build -buildmode=plugin \
		-o plugin.${V}.so \
		-ldflags="-pluginpath=plugin_${V}" plugin.go

curl:
	curl 127.0.0.1:12311/call
	curl 127.0.0.1:12311/reload?v=${V}
	curl 127.0.0.1:12311/call
